export const mutations={
  setUserID(state,id){
    state.userID = id
  },
  setAvatar(state, file){
    state.baseInfoMessageAdd.file = file
  },
  setHasMounted(state){
    state.hasMounted = !state.hasMounted
  },
  // 基本信息
  setNickName (state,nickName) {
    state.baseInfoMessageAdd.nickName = nickName
  },
  setSex(state, sex){
    if(sex === '男') {
      state.baseInfoMessageAdd.sex = 1
    }else if (sex === '女') {
      state.baseInfoMessageAdd.sex = 2
    }
  },
  setAge(state, age) {
    state.baseInfoMessageAdd.age = age
  },
  setWorkLength(state, workLength) {
    state.baseInfoMessageAdd.workLength = workLength
  },
  setCity(state,city) {
    state.baseInfoMessageAdd.city = city
  },
  setCompany(state,company) {
    state.baseInfoMessageAdd.company = company
  },
  setPosition(state, position) {
    state.baseInfoMessageAdd.position = position
  },
  setDirection(state, data) {
    state.baseInfoMessageAdd.direction = data.code
    state.baseInfoMessageAdd.directionName = data.position
  },
  setStatus(state, status) {
    if(status === '求职') {
      console.log(status)
      state.baseInfoMessageAdd.status = 0
    }else if (status === '自由工作') {
      state.baseInfoMessageAdd.status = 1
    }else if (status === '正常工作') {
      state.baseInfoMessageAdd.status = 2
    }
  },
  setPInformationAdd(state){
    state.baseInfoMessageAdd = {}
  },
  setPInformation(state){
    state.baseInfoMessageAdd.nickName = state.baseInfoMessage.nickName
    state.baseInfoMessageAdd.age = state.baseInfoMessage.age
    state.baseInfoMessageAdd.workLength = state.baseInfoMessage.workLength
    state.baseInfoMessageAdd.city = state.baseInfoMessage.city
    state.baseInfoMessageAdd.company = state.baseInfoMessage.company
    state.baseInfoMessageAdd.position = state.baseInfoMessage.position
    state.baseInfoMessageAdd.direction = state.baseInfoMessage.direction
    state.baseInfoMessageAdd.directionName = state.baseInfoMessage.directionName
    state.baseInfoMessageAdd.image = state.baseInfoMessage.image
  },
  //工作说明
  setWorkExplain(state,data){
    state.workExplainAdd.price = date.workExplain.price
    state.workExplainAdd.normalStartTime = data.workExplain.normalStartTime
    state.workExplainAdd.normalEndTime = data.workExplain.normalEndTime
    state.workExplainAdd.weekStartTime = data.workExplain.weekStartTime
    state.workExplainAdd.weekEndTime = data.workExplain.weekEndTime
    state.workExplainAdd.workAddress = data.workExplain.workAddress
  },

  //个人介绍
  setIntroduction(state, introduction){
    state.introduction = introduction
  },

  // 工作经历
  setWorkExperimentAdd(state, data){
    if(data){
      if(data.company){
        state.workExperimentAdd.company = data.company
      }
      if(data.position){
        state.workExperimentAdd.position = data.position
      }
      if(data.startTime){
        state.workExperimentAdd.startTime = data.startTime
      }
      if(data.endTime){
        state.workExperimentAdd.endTime = data.endTime
      }
      if(data.experienceDesc){
        state.workExperimentAdd.endTime = data.endTime
      }
      if(data.workCertificate){
        state.workExperimentAdd.workCertificate = data.workCertificate
      }
      if(data.showFirst){
        state.workExperimentAdd.showFirst = data.showFirst
      }
    }
  },
}
